/**
* A coding agent for developing new features
*
* @param assignment Assignment to complete
* @param source The source directory
*/
@Function
public Directory develop(String assignment, @DefaultPath("/") Directory source)
throws ExecutionException, DaggerQueryException, InterruptedException {
// Environment with agent inputs and outputs
Env environment = dag()
    .env()
    .withStringInput("assignment", assignment, "the assignment to complete")
    .withWorkspaceInput(
    "workspace",
    dag().workspace(source),
    "the workspace with tools to edit and test code"
    )
    .withWorkspaceOutput("completed", "the workspace with the completed assignment");

// Detailed prompt stored in markdown file
File promptFile = dag().currentModule().source().file("develop_prompt.md");

// Put it all together to form the agent
LLM work = dag().llm().withEnv(environment).withPromptFile(promptFile);

// Get the output from the agent
Workspace completed = work.env().output("completed").asWorkspace();
Directory completedDirectory = completed.source().withoutDirectory("node_modules");

// Make sure the tests really pass
test(completedDirectory);

// Return the Directory with the assignment completed
return completedDirectory;
}
